﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace SX.Utils.Nosql
{
    public class RedisConfig
    {
        public RedisConfig()
        {
            ConnectTimeout = -1;
        }

        List<EndPoint> _servereList = new List<EndPoint>();

        public List<EndPoint> ServereList
        {
            get { return _servereList; }
        }

        public string Password { get; set; }

        public int ConnectTimeout { get; set; }

        public static RedisConfig GetConfig(string connstring)
        {
            RedisConfig config = new RedisConfig();

            string[] snapList = connstring.Split(',');

            foreach (string snap in snapList)
            {
                if (snap.IndexOf("=",StringComparison.OrdinalIgnoreCase) > 0)
                {

                }
                else
                {
                     EndPoint endPoint = new IPEndPoint(,);
                }
            }

            return config;
        }
    }

    internal class RedisServer
    {
        public RedisServer()
        {
            Enable = true;
        }

        public EndPoint Server { get; set; }

        public bool Enable { get; set; }
    }
}
